package com.system.commonutils.utils;

import java.security.MessageDigest;

public class Md5Utils {

	public static String md5(String value) {
		try {
			value = value + "com.jdbc";
			MessageDigest messageDigest = MessageDigest.getInstance("MD5");
			messageDigest.update(value.getBytes("UTF8"));
			byte message[] = messageDigest.digest();
			String result = "";
			for (int i = 0; i < message.length; i++) {
				result += Integer.toHexString((0x000000FF & message[i]) | 0xFFFFFF00).substring(6);
			}
			return result;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}
}
